package ticker.manager 
{
	/**
	 * 秒表计时器
	 * tick时间为1秒钟
	 * @author gcxk721
	 */
	public class TimeTickManager extends BaseTickerManager 
	{
	
		/**
		 * 间隔时间  
		 * 没用const  方便子类直接继承修改时间
		 */
		private var _delay : int = 0;
		
		/**
		 * 计时
		 */
		private var _tmpTime : int = 0;
		
		/**
		 * 修正值
		 */
		private var _offSet : int = 0;
		
		/**
		 * 传进来的为计时时间
		 * @param	delay
		 */
		public function TimeTickManager(tickName : String, delay : uint = 1000) 
		{
			super(tickName);
			_delay = delay;
		}
		
		override public function onTicker(time:int):void 
		{
			_tmpTime += time;
			if ((_tmpTime + _offSet) >= _delay)//条件完成
			{
				for (var i : int = 0; i < lstLength; ++i)
				{
					tickerLst[i].onTicker(_tmpTime);//传入值为实际时间
				}
				_offSet = _tmpTime - _delay;
				_tmpTime = 0;
			}
		}
	
	}

}